home *** CD-ROM | disk | FTP | other *** search
/ 3D Game Programming All in One / 3D Game Programming All in One Disc.iso / 3D2E / RESOURCES / KOOB / common / client / audio.cs < prev    next >
Text File  |  2005-11-23  |  1KB  |  51 lines

  1. //-----------------------------------------------------------------------------
  2. // Torque Engine
  3. // 
  4. // Copyright (C) GarageGames.com, Inc.
  5. //-----------------------------------------------------------------------------
  6.  
  7. function OpenALInit()
  8. {
  9.    OpenALShutdownDriver();
  10.  
  11.    echo("");
  12.    echo("OpenAL Driver Init:");
  13.  
  14.    echo ($pref::Audio::driver);
  15.  
  16.    if($pref::Audio::driver $= "OpenAL")
  17.    {
  18.       if(!OpenALInitDriver())
  19.       {
  20.          error("   Failed to initialize driver.");
  21.          $Audio::initFailed = true;
  22.       } else {
  23.          // this should go here
  24.          echo("   Vendor: " @ alGetString("AL_VENDOR"));
  25.          echo("   Version: " @ alGetString("AL_VERSION"));  
  26.          echo("   Renderer: " @ alGetString("AL_RENDERER"));
  27.          echo("   Extensions: " @ alGetString("AL_EXTENSIONS"));
  28.  
  29.          alxListenerf( AL_GAIN_LINEAR, $pref::Audio::masterVolume );
  30.    
  31.          for (%channel=1; %channel <= 8; %channel++)
  32.             alxSetChannelVolume(%channel, $pref::Audio::channelVolume[%channel]);
  33.  
  34.          echo("");
  35.       }
  36.    }
  37.  
  38. }
  39.  
  40.  
  41. //--------------------------------------------------------------------------
  42.  
  43. function OpenALShutdown()
  44. {
  45.    OpenALShutdownDriver();
  46.    //alxStopAll();
  47.    //AudioGui.delete();
  48.    //sButtonDown.delete();
  49.    //sButtonOver.delete();
  50. }
  51.